package com.topisv.tms.mybatis;
/**
 * mysql方言
 * @author Fisher
 * @version 1.0.0
 */
public class MysqlDialect implements Dialect {

	@Override
	public boolean supportsLimit() {
		return true;
	}

	@Override
	public boolean supportsLimitOffset() {
		return true;
	}

	@Override
	public String getLimitString(String querySelect, boolean hasOffset,
			int start, int size) {
		// hasOffset always true
		if ( start > 0 ) {
		    return querySelect + " LIMIT " + start + "," + size;
		} else {
			return querySelect + " LIMIT " + size;
		}
	}

}
